<%@ page import="javax.naming.Context" %>
<%@ page import="javax.naming.InitialContext" %>
<%@ page import="com.dao.JNDIBaseDao" %>
<%@ page import="java.sql.Connection" %><%--
  Created by IntelliJ IDEA.
  User: Elle
  Date: 2022/6/21
  Time: 9:09
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>测试JNDI</title>
</head>
<body>

<%

    Context ctx = new InitialContext();

    String jndi = (String) ctx.lookup("java:comp/env/tjndi");

    out.println(jndi);

    JNDIBaseDao baseDao = new JNDIBaseDao();
    Connection conn = baseDao.getConnection();
    out.println(conn);


%>



</body>
</html>
